package fr.paulmasson.jfreex.db.bo;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@SuppressWarnings("serial")
@Entity
public class BoChannel extends Bo implements Serializable {

	public int id;

	public BoProvider provider;
	public String name = "";
	public String hd = "";
	public String sd = "";
	public String ld = "";
	
	public static String[] getColumns() {
		return new String[]{"Id","Name","Provider","HD","SD","LD"};
	}
	
	public String getColumnValue(Integer i) {
		switch(i) {
			case 0:
				return getId()+"";
			case 1:
				return getName();
			case 2:
				return getProvider().toString();
			case 3:
				return getHd();
			case 4:
				return getSd();
			case 5:
				return getLd();
		}
		return null;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne
    @JoinColumn(name="provider_fk")
	public BoProvider getProvider() {
		return provider;
	}

	public void setProvider(BoProvider provider) {
		this.provider = provider;
	}
	
	

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getHd() {
		return hd;
	}

	public void setHd(String hd) {
		this.hd = hd;
	}

	public String getSd() {
		return sd;
	}

	public void setSd(String sd) {
		this.sd = sd;
	}

	public String getLd() {
		return ld;
	}

	public void setLd(String ld) {
		this.ld = ld;
	}
	
	
	public static String getTableName() {
		return "BoChannel";
	}
	
	public String toString() {
		return this.getId()+":"+this.getName();
	}

}
